home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
sgrege_1
/
bsscdhtm.js
next >
Wrap
Text File
|
1998-06-23
|
18KB
|
502 lines
// RoboHELP« HTML Edition Dynamic HTML Effects Script
// Copyright ⌐ 1998 Blue Sky Software Corporation. All rights reserved.
// Version=1
// Warning: Do not modify this file. It is generated by RoboHELP« HTML Edition and changes will be overwritten.
function animationContext(el, progressAnimation, finishAnimiation, animationDuration, animationPeriod)
{
this.el = el;
this.progressAnimation = progressAnimation;
this.finishAnimiation = finishAnimiation;
this.animationDuration = parseFloat(animationDuration);
this.animationPeriod = animationPeriod;
this.animationStartTime = (new Date()).getTime();
this.continueAnimation = true;
}
function progressFade(ndx)
{
percent = ((new Date()).getTime() - animationContexts[ndx].animationStartTime)/animationContexts[ndx].animationDuration;
if (percent > 1.0)
{
percent = 1.0;
animationContexts[ndx].continueAnimation = false;
}
animationContexts[ndx].el.filters.alpha.opacity = animationContexts[ndx].initialOpacity*(1.0-percent) + animationContexts[ndx].finalOpacity*percent;
}
function finishFade(ndx)
{
animationContexts[ndx].el.filters.alpha.opacity = parseInt(animationContexts[ndx].finalOpacity);
}
function progressTranslation(ndx)
{
percent = ((new Date()).getTime() - animationContexts[ndx].animationStartTime)/animationContexts[ndx].animationDuration;
if (percent > 1.0)
{
percent = 1.0;
animationContexts[ndx].continueAnimation = false;
}
animationContexts[ndx].el.style.pixelLeft = animationContexts[ndx].startX*(1.0-percent) + animationContexts[ndx].finalX*percent;
animationContexts[ndx].el.style.pixelTop = animationContexts[ndx].startY*(1.0-percent) + animationContexts[ndx].finalY*percent;
}
function finishTranslation(ndx)
{
animationContexts[ndx].el.style.pixelLeft = parseInt(animationContexts[ndx].finalX);
animationContexts[ndx].el.style.pixelTop = parseInt(animationContexts[ndx].finalY);
}
var animationContexts = new Array();
var BSSCSequenceIndex = 0;
function animationPump(ndx)
{
animationContexts[ndx].progressAnimation(ndx);
if (animationContexts[ndx].continueAnimation)
animationContexts[ndx].tm = setTimeout("animationPump(" + ndx + ");", animationContexts[ndx].animationPeriod);
}
function clearAnimations()
{
for (index=0; index<animationContexts.length; index++)
{
animationContexts[index].finishAnimiation(index);
clearTimeout(animationContexts[index].tm);
}
animationContexts = new Array();
}
function startNextAnimationSet()
{
clearAnimations();
bStarted = false;
bFound = false
// Determine the next sequence number
divElements = document.all.tags("DIV");
for (index = 0; index < divElements.length; index++)
{
el = divElements[index];
objectOrder = el.getAttribute("BSSCObjectOrder", false);
if(null != objectOrder)
{
objectOrder = parseInt(objectOrder);
if (objectOrder > BSSCSequenceIndex && (!bFound || objectOrder < minBSSCSequenceIndexFound))
{
minBSSCSequenceIndexFound = objectOrder;
bFound = true;
}
}
}
if (bFound)
{
BSSCSequenceIndex = minBSSCSequenceIndexFound;
bStarted = startAnimationSet(BSSCSequenceIndex);
}
}
function getOffsetFromTopOfBrowser(el)
{
if (null == el.offsetParent)
return el.offsetTop;
else
return el.offsetTop + getOffsetFromTopOfBrowser(el.offsetParent);
}
function startAnimationSet(ndx)
{
animationContextIndex = 0;
bStarted = false;
// Find document elements with "BSSCAnimationType" attribute
divElements = document.all.tags("DIV");
for (index = 0; index < divElements.length; index++)
{
el = divElements[index];
animationType = el.getAttribute("BSSCAnimationType", false);
if(null != animationType)
{
framePeriod = el.getAttribute("BSSCFramePeriod", false);
frameCount = el.getAttribute("BSSCFrameCount", false);
sequenceIndex = el.getAttribute("BSSCObjectOrder", false);
// Stop any currently running RevealTrans filters
if ("RevealTrans" == animationType && parseInt(sequenceIndex) == ndx-1)
el.filters.RevealTrans.stop();
// Filter on ndx
if (0 == ndx && null == sequenceIndex ||
ndx == parseInt(sequenceIndex))
{
if ("FlyInFromRight" == animationType)
{
animationDuration = el.getAttribute("BSSCDuration", false);
if (null == animationDuration)
animationDuration = 1000; // default to 1s
animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
animationContexts[animationContextIndex].startX = document.body.clientWidth;
animationContexts[animationContextIndex].startY = 0;
animationContexts[animationContextIndex].finalX = 0;
animationContexts[animationContextIndex].finalY = 0;
animationPump(animationContextIndex++);
bStarted = true;
}
if ("FlyInFromLeft" == animationType)
{
animationDuration = el.getAttribute("BSSCDuration", false);
if (null == animationDuration)
animationDuration = 1000; // default to 1s
for (childIndex=0; childIndex<el.children.length; childIndex++)
{
if ("left" == el.children[childIndex].style.textAlign)
el.children[childIndex].style.textAlign = "right";
}
pixelsToTranslate = document.body.clientWidth;
animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
animationContexts[animationContextIndex].startX = -document.body.clientWidth;
animationContexts[animationContextIndex].startY = 0;
animationContexts[animationContextIndex].finalX = 0;
animationContexts[animationContextIndex].finalY = 0;
animationPump(animationContextIndex++);
bStarted = true;
}
if ("FlyInFromBottom" == animationType)
{
animationDuration = el.getAttribute("BSSCDuration", false);
if (null == animationDuration)
animationDuration = 1000; // default to 1s
animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
animationContexts[animationContextIndex].startX = 0;
animationContexts[animationContextIndex].startY = document.body.clientHeight - el.offsetTop;
animationContexts[animationContextIndex].finalX = 0;
animationContexts[animationContextIndex].finalY = 0;
animationPump(animationContextIndex++);
bStarted = true;
}
if ("FlyInFromTop" == animationType)
{
animationDuration = el.getAttribute("BSSCDuration", false);
if (null == animationDuration)
animationDuration = 1000; // default to 1s
animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
animationContexts[animationContextIndex].startX = 0;
animationContexts[animationContextIndex].startY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
animationContexts[animationContextIndex].finalX = 0;
animationContexts[animationContextIndex].finalY = 0;
animationPump(animationContextIndex++);
bStarted = true;
}
if ("FlyInFromBottomRight" == animationType)
{
animationDuration = el.getAttribute("BSSCDuration", false);
if (null == animationDuration)
animationDuration = 1000; // default to 1s
pixelsToTranslate = document.body.clientWidth;
if (document.body.clientHeight - el.offsetTop < pixelsToTranslate)
pixelsToTranslate = document.body.clientHeight - el.offsetTop;
animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
animationContexts[animationContextIndex].startX = pixelsToTranslate;
animationContexts[animationContextIndex].startY = pixelsToTranslate;
animationContexts[animationContextIndex].finalX = 0;
animationContexts[animationContextIndex].finalY = 0;
animationPump(animationContextIndex++);
bStarted = true;
}
if ("FlyInFromTopRi